﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace KasaTakip
{
    public partial class frmSifre : DevExpress.XtraEditors.XtraForm
    {
        public frmSifre()
        {
            InitializeComponent();
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            Kontrol();
        }

        private void Kontrol()
        {
            if (txtSifre.Text == string.Format("{0}{1}{2}", DateTime.Now.Day, DateTime.Now.Month, DateTime.Now.Year))
            {
                this.DialogResult = System.Windows.Forms.DialogResult.OK;
                this.Close();
            }
            else
            {
                txtSifre.Text = "";
                MessageBox.Show("Yanlış şifre");
            }
        }

        private void txtSifre_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                Kontrol();
            }
        }
    }
}